package thu.sorit.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class ScreenListener extends BroadcastReceiver {

	private SoritService service;
	
	public ScreenListener(SoritService service) {
		this.service = service;
	}
	
	@Override
	public void onReceive(Context context, Intent intent) {
		if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
			service.notifyScreen(false);
		} else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
			service.notifyScreen(true);
		}
	}

}
